package com.atguigu.rule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyRuler {
    // 1. 写在ComponentScan 扫描不到的路径，不然该负载均衡配置当作为全局配置
    @Bean
    public IRule myRule(){
        return new RandomRule();
    }
}
